package game.buildings;

import game.resources.*;

/**
 *	@(#)Mine.java
 *
 *	The <code>Mine</code> class represents the mine building.
 *	A mine is a prodcuer and provides gold or stone.
 *
 *	@author Grzegorz Kobiela
 *	@version 1.0 2008/4/23
 */
public final class Mine
extends Producer
{
	/**
	 *	Creates a new <code>Mine</code> instance.
	 */
	public Mine() {
		super(BuildingType.MINE);
	}

	/**
	 *	Adds the given resource to the list of resources.
	 *	@param resource the resource
	 */
	@Override
	public void addResource(Resource resource) {
		if(resource instanceof Gold || resource instanceof Stone) {
			super.addResource(resource);
		} else {
			throw new IllegalArgumentException("Mines do not produce " + resource + "!");
		}
	}
}